﻿/*
* This file is part of WinMergeFS.
*
* WinMergeFS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.

* WinMergeFS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WinMergeFS.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WinMergeFS.Common;

namespace WinMergeFS.RootSelect
{
    public class RootSelectPlugin : IRootSelectPlugin
    {
        private Profile _profile;
        private LoggerEventHandler _logger;
        private RootSelectHelper _rootselecthelper;

        #region IRootSelectPlugin Member

        public string PluginAuthor
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string PluginDescription
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string PluginID
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public void PluginRegister(Profile profile, LoggerEventHandler logger, ref Dictionary<string, RootSelectPluginDelegate> fileratinghandler, ref Dictionary<string, RootSelectPluginDelegate> dirratinghandler)
        {
            _profile = profile;
            _logger = logger;
            _rootselecthelper = new RootSelectHelper(_profile);
            fileratinghandler.Add("test", new RootSelectPluginDelegate(Test));
            dirratinghandler.Add("test", new RootSelectPluginDelegate(Test));
            _logger("Plugin_test loaded", LogLevel.debug);
        }

        public string PluginVersion
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        #endregion

        public void Test(Profile profile, ref List<int> rootrating, string filename)
        {
            rootrating[0] = -2;
            _logger("Plugin_test executed", LogLevel.debug);
        }
    }
}
